<?php

class Application_Form_OrderAccess extends Zend_Form
{

    public function init()
    {
        $this->setMethod('post')
        	->setAttrib('id', 'orderAccess');
        
        $this->clearDecorators();
        
        $decorators = array(
        		array('ViewHelper'),
        		array('Errors'),
        		array('Label', array('requiredSuffix' => ' *', 'class' => 'leftalign')),
        		array('HtmlTag', array('tag' => 'li')),
        );
        
        $secureId = $this->addElement('text', 'sec_id',
        		array('label' => 'Secure Token Id'));
        $secureId = $this->getElement('sec_id')
        		->setRequired(true)
        		->addFilter('StringTrim');
        $secureId->setDecorators($decorators);
        
        $access = $this->addElement('submit', 'access',
        		array('label' => 'Access'));
        $access = $this->getElement('access')
        		->setDecorators(array(
        			array('ViewHelper'),
        ));
        
        $cancel = $this->addElement('submit', 'cancel',
        		array('label' => 'Cancel'));
        $cancel = $this->getElement('cancel')
        		->setDecorators(array(
        			array('ViewHelper'),
        ));
        
        $this->addDisplayGroup(array('access', 'cancel'), 'submit_buttons',
        		array('disableLoadDefaultDecorators' => true));
        $submitButtons = $this->getDisplayGroup('submit_buttons');
        $submitButtons->addDecorators(array(
        		array('FormElements', 'Form'),
        		array('HtmlTag', array('tag' => 'li', 'class' => 'submit')),
        ));
        
        $this->setDecorators(array(
        		'FormElements',
        		array('HtmlTag', array('tag' => 'ul')),
        		array(array('DivTag' => 'HtmlTag'),
        				array('tag' => 'div', 'id' => 'orderAccessDiv')),
        		'Form'
        ));
    }


}

